#include "MultiplicativeExpr.h"

#include "CastExpr.h"
#include <iostream>
#include <string>
#include <assert.h>
MultiplicativeExpr::~MultiplicativeExpr(void)
{
	switch(m_iType)
	{
	case cast_expr:
		delete m_pSingleExpr;
		break;
	case mul_expr:
	case div_expr:
	case mod_expr:
		delete m_pMulExpr;
		delete m_pCastExpr;
		break;
	default:
		std::cout<<"MultiplicativeExpr::~MultiplicativeExpr(), Unkonown type!\n"<<std::endl;
		exit(1);
	}
}

void MultiplicativeExpr::codeGen()
{
	COUT
	switch(m_iType)
	{
		case cast_expr:
			m_pSingleExpr->codeGen();
			break;
		case mul_expr:
		case div_expr:
		case mod_expr:
			m_pMulExpr->codeGen();
			m_pCastExpr->codeGen();
			break;
		default:
			std::cout<<"MultiplicativeExpr::codeGen(), Unkonown type!\n"<<std::endl;
			exit(1);
	}
}